package cn.tedu.spring.auto;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 测试类，用于测试@Autowired注解注入接口类型的实现类
 */
public class TestUserCache {
    public static void main(String[] args) {

        ApplicationContext context = new AnnotationConfigApplicationContext(
                "cn.tedu.spring.auto"
        );


        try{
            UserCache userCache = context.getBean(UserCache.class);
            userCache.getCache().run();
        }catch (Exception e){
            System.out.println(e.getMessage());
        }
    }
}
